package com.yds.modewithprinceple.factory.image.abstracts;

/**
 * @author YDS
 * @date 2021/5/10
 * @discribe
 */
@SuppressWarnings("all")
public class ImageLoadFactory extends BaseFactory {
    @Override
    public <T extends IImageLoadListener> T load(Class<T> clz) {
        try {
            Class<?> aClass = Class.forName(clz.getName());
            IImageLoadListener instance = (IImageLoadListener) aClass.newInstance();
            return (T) instance;
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        }
        return null;
    }
}
